<!DOCTYPE html>
<!--WimBuilder_UI.hta-->
<html>
<head>
    <HTA:Application id="oWimBuilderUI"
        applicationname="WimBuilderUI"
        icon="assets\builder.ico" />

    <title>Wim Builder</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link rel="stylesheet" href="assets/vendor/pure-min.css" />
    <link rel="stylesheet" href="assets/vendor/jstree/themes/default/style.min.css" />
    <link rel="stylesheet" href="assets/vendor/jquery-ui/jquery-ui.min.css">

    <link rel="stylesheet" href="assets/css/side-menu.css" />
    <link rel="stylesheet" href="assets/css/page.css" />
    <link rel="stylesheet" href="assets/css/page_patch.css" />
    <link rel="stylesheet" href="assets/css/ibutton.css" />
    <link rel="stylesheet" href="assets/css/switch.css" />
    <link rel="stylesheet" href="assets/htakit/css/uikit-tab.css" />
    <link rel="stylesheet" href="assets/css/alert.css" />
</head>

<body  onbeforeunload="window_beforeunload()">
<script>var $IE_VER = '0';</script>
 <!--[if lte IE 6]>
    <script>$IE_VER = '-6';</script>
 <![endif]-->

  <!--[if IE 7]>
    <script>$IE_VER = '7';</script>
 <![endif]-->

 <!--[if lt IE 9]>
    <script>$IE_VER = '8';</script>
    <script src="assets/js/ES5_fix.js"></script>
    <script src="assets/vendor/jquery-1.12.4.min.js"></script>
    <style>
        /* overwrite onoffswitch css */
        .onoffswitch-label {
        display: none;
        }
    </style>
<![endif]-->

 <!--[if gte IE 9]>
      <script>$IE_VER = '9+';</script>
      <script src="assets/vendor/jquery-3.3.1.min.js"></script>
<![endif]-->

<script>
// Edage
if ($IE_VER == '0') {
    $IE_VER = '9+';
    document.write('<script src="assets/vendor/jquery-3.3.1.min.js"><\/script>');
    /*
    var head_script = document.createElement("script");
    head_script.type = "text/javascript";
    head_script.src = "assets/vendor/jquery-3.3.1.min.js";
    document.getElementsByTagName('head')[0].appendChild(head_script);
    */
}
</script>

<script src="assets/vendor/jstree/jstree.min.js"></script>
<script src="assets/vendor/marked.min.js"></script>
<script src="assets/vendor/jquery-ui/jquery-ui.min.js"></script>
<script src="assets/htakit/js/htakit.js"></script>
<script src="assets/js/fs_project.js"></script>
<script src="assets/js/fs_patch.js"></script>
<script src="assets/js/helper_html.js"></script>
<script src="assets/js/helper_i18n.js"></script>
<script src="assets/js/helper_page.js"></script>
<script src="assets/js/definition.js"></script>
<script src="assets/default_config.js"></script>
<script src="assets/info.js"></script>
<script src="config.js"></script>
<script src="auto_config.js"></script>

<div>
  <input type="file" style="display:none" id="$f" /> <!-- gobal OpenFileDialog element -->
</div>
<div id="layout">

<!-- ############################# Menu Start ############################# -->
<script>
if ($IE_VER == '9+') {
    document.write('<a href="#menu" id="menuLink" class="menu-link">');
    document.write('        <!-- Hamburger icon -->');
    document.write('        <span></span>');
    document.write('</a>');
}
</script>

 <!--[if lt IE 9]>
<div>
<div id="menu_fixed" style="float:left;width:150px">
<style>
#menu_fixed .pure-menu {
  height:100%;
  background:#000;
}

#menu_fixed .pure-menu-heading {
  color:#fff;
}
#menu_fixed .pure-menu-item:active {
    background:#eee;
}
#menu_fixed .pure-menu-selected {
    background:#1f8dd6;
}

#menu_fixed .pure-menu-selected a {
    color:#fff;
}
</style>
<![endif]-->

<script>
if ($IE_VER == '9+') {
    document.write('<div id="menu">');
}
</script>
    <div class="pure-menu">
        <a class="pure-menu-heading" href="#">WimBuilder</a>
        <ul class="pure-menu-list">
            <li class="pure-menu-item"><a href="#" class="pure-menu-link i18n-text" id="menu_start">Getting Started</a></li>
            <li class="pure-menu-item"><a href="#" class="pure-menu-link i18n-text" id="menu_project">Project</a></li>
            <li class="pure-menu-item"><a href="#" class="pure-menu-link i18n-text" id="menu_patch">Patches</a></li>
            <li class="pure-menu-item"><a href="#" class="pure-menu-link i18n-text" id="menu_build">Building</a></li>
            <li class="pure-menu-item"><a href="#" class="pure-menu-link i18n-text" id="menu_about">About</a></li>
        </ul>
    </div>
</div>
<!-- ############################# Menu End ############################# -->

<!-- ############################# content Start ############################# -->

<!--[if lt IE 9]>
<div id="content" style="margin-left:160px;margin-bottom:40px">
<![endif]-->

<script>
if ($IE_VER == '9+') {
    document.write('<div id="content" style="margin-bottom:40px">');
}
</script>

<div id="page_header">
<div id="quick_build" style="display:none;float:right;margin:5px 10px 0px 0px">
    <a href="#" title="Quick build" class="i18n-title" onclick="do_quick_build();"
       style="display:inline-block;height:48px;width:48px;background-image:url(assets/img/play.png)" ></a>
    <div style="display:inline-block;height:48px;">
    <label for="quick_build_mode_run">
        <input type="radio" name="quick_build_mode" id="quick_build_mode_run" /><span class="i18n-text">build(cmd)</span><br/>
    </label>
    <label for="quick_build_mode_exec">
        <input type="radio" name="quick_build_mode" id="quick_build_mode_exec" checked /><span class="i18n-text">build(log)</span>
    </label>
    </div>
</div>
</div>

<!-- ############################# page_start Start ############################# -->
<div id="page_start" class="content_page pure-form">

<div id="page_start_info" style="display:none" class="alert alert-info i18n-html"><strong>INFO</strong>:You can set the default settings in 'config.js', and your selection will auto save in 'auto_config.js', make you start quickly for next time. If you want to modify the settings later, use the left-side navigition menu to show this page.</div>
<br/>
<div style="display:none"> <!-- hide workspace -->
<input type="text" id="wb_workspace" style="width:450px" value="D:\WB_Workspace" />
<a href="#" disabled="disabled" id="wb_workspace_folder_btn" class="ibutton browse i18n-title i18n-text"
    title="Set the build workspace">Browse...</a><br/>
</div>

<span style="font-weight:bold;color:#000;" class="i18n-text">Please select the Windows ISO folder/drive, or the 'sources' folder(auto detect)</span><br/>
<input type="text" id="wb_src_folder" style="width:450px" value="" />
<!-- keep same align -->
<select style="visibility:hidden"><option value ="-1">-</option></select>
<a href="#" id="wb_src_folder_btn" class="ibutton browse i18n-title i18n-text"
    title="Select the image path or the 'sources' folder">Browse...</a><br/>

<span style="font-weight:bold;color:#000;" class="i18n-text">Select the install.wim file if it needed</span><br/>
<input type="text" id="wb_src" style="width:450px" value="D:\WB_Workspace\mnt\install.wim" />
<script>
    document.write('<select id="wb_src_idx_opt">');
    document.write('  <option value ="-1">-</option>');
    for (var i = 1; i < 100; i++) {
        document.write('<option value="' + i + '">' + i + '</option>');
    }
    document.write('</select>');
</script>

<a href="#" id="wb_src_wim_btn" class="ibutton browse i18n-title"
    title="Select the install.wim file if it needed">Wim</a>

<label for="wb_auto_winre">
    <input type="checkbox" id="wb_auto_winre" checked /><span class="i18n-text">Auto extract the winre.wim</span>
</label>
<div id="wb_src_alert" class="alert alert-info i18n-html" style="display:none"><strong>INFO</strong>:the install.wim isn't exist.</div>
<div id="wb_src_wiminfo" class="alert alert-info">wim information</div>

<br/>
<span style="font-weight:bold;color:#000;" class="i18n-text">Select the base image(boot.wim/winre.wim or other customed.wim)</span><br/>
<input type="text" id="wb_base" style="width:450px" />
<select id='wb_base_idx_opt'>
  <option value ="-1">-</option>
  <option value ="1">1</option>
  <option value ="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
</select>


<a href="#" id="wb_base_wim_btn" class="ibutton browse i18n-title" 
    title="Select the base image(boot.wim/winre.wim or other customed.wim)">Wim</a>

<label for="wb_use_testwim">
    <input type="checkbox" id="wb_use_testwim" /><span class="i18n-text">Use test\boot.wim</span>
</label>

<div id="wb_base_alert" class="alert alert-error i18n-html" style="display:none"><strong>ERROR</strong>:the base wim isn't exist.</div>
<div id="wb_base_wiminfo" class="alert alert-info">wim information</div>

    <div>
        <button class="pure-button pre-button" enable="false">&lt;pre</button>
        <button class="pure-button next-button" onclick="$('#menu_project').click()">next&gt;</button>
    </div>

<br/>
<br/>
<div class="alert alert-warning i18n-html"><strong>Notice</strong>:Please select the correct wim file, and the image index, otherwise cause build failed.</div>

</div>
<!-- ############################# page_start End ############################# -->


<!-- ############################# page_project Start ############################# -->
<div id="page_project" class="content_page">
    <div>
        <a href="#" class="ibutton prev" onclick="$('#menu_start').click()">Prev</a>
        <a href="#" class="ibutton right next_r" onclick="$('#menu_patch').click()">Next</a>
        <label for="wb_skip_project_page">
            <input type="checkbox" id="wb_skip_project_page" /><span class="i18n-text">Skip when project is selected</span>
        </label>
    </div>

<div id="pj_tab">
    <div class="tab tab0">
        <span style="font-weight:bold;color:#000;" class="i18n-text">Please select a project:</span>
        <div>
            <div style="float:left" id="project_list"></div>
        </div>
        <div style="float:left;margin-left:10px">
        <span class="i18n-text">Project Information</span>
        <div id="project_desc"></div>
        </div>
    </div>
    <div class="tab tab1">
        <!-- <span style="font-weight:bold;color:#000;">Project Info</span> -->
        <div id="project_html"></div>
    </div>
</div>
<script type="text/javascript">
    $("#pj_tab").ultab({header:['Projects', 'Details']})
</script>

</div>
<!-- ############################# page_project End ############################# -->


<!-- ############################# page_patches Start ############################# -->
<div id="page_patch" class="content_page">
    <div>
        <button class="pure-button pre-button" onclick="$('#menu_project').click()">&lt;pre</button>
        <button class="pure-button next-button" onclick="$('#menu_build').click()">next&gt;</button>
    </div>
    <div style="margin-top:20px; width:98%; border:0.5px solid #ccc;"></div>
    <div style="margin-top:5px;margin-bottom:-12px">
    <span style="font-weight:bold;color:#000;" class="i18n-text">Current project:</span>
    <span id="patch_project_name"></span>
    <span style="margin-left:180px" class="i18n-text">Patch Preset:</span>
    <!-- Selectmenu -->
    <select id="patch_preset" width="300">
        <option selected="selected">default</option>
        <option>custom</option>
        <option>lite</option>
        <option>-</option>
    </select>
    <button class="ibutton browse i18n-title i18n-text" onclick="OpenFolder($obj_project.path + '\\_Assets_\\preset\\')">Browse...</button>
    </div>
    <div id="patches_area">
        <div id="patches_list" style="overflow:auto">
            <div id="patches_tree"></div>
        </div>
        <div id="patch_html" style="overflow:auto"></div>
    </div>
    <div style="width:98%;height:1px;overflow:auto"></div>
</div>
<!-- ############################# page_patches End ############################# -->


<!-- ############################# page_building Start ############################# -->
<div id="page_build" class="content_page">

    <div id="x-drive-confirm" style="display:none" class="i18n-title" title="Mapping drive is used">
        <p><span class="ui-icon ui-icon-alert" style="float:left; margin:12px 12px 20px 0;"></span>
           <span class="i18n-text">If the Drive is used by the unfinish build, click Continue to go on, it will be fixed,</span><br/>
           <span class="i18n-text">otherwise, please select an usable drive.</span>
        </p>
    </div>

    <div id="x_drive_mapping" style="margin:10px 15px 10px 0px;padding:5px;border:2px solid #c0c0c0;">
        <label class="i18n-text">Subst mounted folder to Drive</label>
        <span style="margin-left:20px" />
        <input type="radio" name="wb_x_drive" style="margin-left:20px" value="auto" checked/><span class="i18n-text"> Auto</span><span id="x_auto_drive" style="color:red">(-)</span>
        <input type="radio" name="wb_x_drive" style="margin-left:20px" value="A:" /> A:
        <input type="radio" name="wb_x_drive" style="margin-left:20px" value="B:" /> B:
        <input type="radio" name="wb_x_drive" style="margin-left:20px" value="V:" /> V:
        <input type="radio" name="wb_x_drive" style="margin-left:20px" value="W:" /> W:
        <input type="radio" name="wb_x_drive" style="margin-left:20px" value="X:" /> X:
        <input type="radio" name="wb_x_drive" style="margin-left:20px" value="Y:" /> Y:
        <input type="radio" name="wb_x_drive" style="margin-left:20px" value="Z:" /> Z:
        <div id="x_drive_notice" class="alert alert-warning i18n-html" style="display2:none"><strong>INFO</strong>:If the mounted folder isn't mapping to X:, The patch scripts need use %X%\ than X:\ when modifying, deleting the files, and please don't create the shortcuts on building, they may point to the wrong target, do it on booting phase.</div>
    </div>
    <div>
        <style scoped>
        .button-green, .button-maroon, .button-orange, .button-lightblue {
            color: white;
            border-radius: 4px;
            text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
        }

        .button-green {
            background: rgb(28, 184, 65); /* this is a green */
        }

        .button-maroon {
            background: rgb(202, 60, 60); /* this is a maroon */
        }

        .button-orange {
            background: rgb(223, 117, 20); /* this is an orange */
        }

        .button-lightblue {
            background: rgb(66, 184, 221); /* this is a light blue */
        }
        </style>
        <button class="pure-button button-green i18n-text" onclick="cleanup()">0-cleanup</button>
        <button class="pure-button button-maroon i18n-text" onclick="run_build()">1-build(cmd)</button>
        <button class="pure-button button-orange i18n-text" onclick="exec_build()">1-build(log)</button>
        <button class="pure-button button-lightblue i18n-text" onclick="make_iso()">2-make_iso</button>
        <label for="wb_auto_makeiso">
            <input type="checkbox" id="wb_auto_makeiso" /><span class="i18n-text">Create ISO after building</span>
        </label>
    </div>
    <div style="margin-top:10px">
        <div class="pure-form">
             <label for="wb_auto_testiso">
                <input type="checkbox" id="wb_auto_testiso" ><span title="WimBuilder2\test\*.cmd" class="i18n-text">Execute command after building:</span>
            </label>
            <input type="text" id="wb_test_cmd" style="width:50%;" class="i18n-placeholder" placeholder="Please input the command.(eg. VBox.cmd testvm)" />
            <button class="pure-button pure-button-primary i18n-text" onclick="test_iso()">Execute</button>
        </div>
        <style type="text/css">
            #wb_test_cmd {
                color: #000;
            }
            #wb_test_cmd:-ms-input-placeholder {
                color: #999;
            }
        </style>
    </div>
    <div id="build_stdout" style="overflow:scroll;margin-top:10px">stdout</div>
    <div style="margin-top:10px">
        <button class="pure-button i18n-text" onclick="OpenFolder(_log_path)">Open log folder</button>
        <button class="pure-button i18n-text" onclick="OpenFile(_log_path + '\\last_wimbuilder.log')">Open last build log</button>
    </div>
    <div>
        <button class="pure-button pre-button" onclick="$('#menu_patch').click()">&lt;pre</button>
        <button class="pure-button next-button" onclick="$('#menu_about').click()">next&gt;</button>
    </div>
</div>
<!-- ############################# page_building End ############################# -->

<!-- ############################# page_about Start ############################# -->
<div id="page_about" class="content_page">
    <span>I am lazy, nothing left here.</span>
    <button onclick="self.close()">closeMe</button>
    <br/><br/>
    Project:<a herf="https://github.com/slorelee/wimbuilder2">https://github.com/slorelee/wimbuilder2</a><br/>
    Chinese:<a herf="http://bbs.wuyou.net/forum.php?mod=viewthread&tid=411399">http://bbs.wuyou.net/forum.php?mod=viewthread&tid=411399</a><br/>
    English:<a herf="http://theoven.org/index.php?topic=2390.0">http://theoven.org/index.php?topic=2390.0</a><br/>
</div>
<!-- ############################# page_about End ############################# -->

</div>
<!-- ############################# content End ############################# -->
 <!--[if lt IE 9]>
 </div>
<![endif]-->

</div>

<style type="text/css">
    #statusbar {
        position: fixed;right: 0;top: 100%;
        height: 30px;width: 100%;
        transform: translate(0,-100%);
        background-color: #191818;color: white;
    }
    #status_text_div {
        float:right;margin-top:-10px;
        margin-right: 5px;
    }
</style>

<!--[if lt IE 9]>
<style type="text/css">
    #statusbar {
        left: 150px;bottom: 0px;right: auto;top: auto;
    }
    #status_text_div {
        margin-right: 155px;
    }
</style>
<![endif]-->

<div id="statusbar">
    <div id="status_text_div"><p id="status_text"></p></div>
</div>

<script src="assets/js/i18n.js"></script>
<script type="text/javascript">
    document.title = document.title + " - v" + $wb_verstr;
    function window_onload() {
        var w = $width, h = $height; 
        window.resizeTo(w, h);
        window.moveTo((window.screen.width - w) / 2,
            (window.screen.height - h) / 2);
    }
    i18n_init();
    window_onload();
    if ($IE_VER != '9+') {
        $("#menu_fixed").css('height', $height - 42);
    }

    function window_beforeunload() {
        if ($wb_auto_save_window_size) {
            var w = window.outerWidth, h = window.outerHeight;
            if (typeof(w) == 'number') $width = w;
            if (typeof(h) == 'number') $height = h;
        }
        auto_save_settings();
    }
</script>
<script src="assets/js/page_start.js"></script>
<script src="assets/js/page_project.js"></script>
<script src="assets/js/page_patches.js"></script>
<script src="assets/js/page_build.js"></script>
<script src="assets/js/menu_click.js"></script>
<script src="assets/js/init.js"></script>
</body>
</html>
